package com.zcp.todayheadline.application;

import android.app.Application;
import android.os.Environment;

import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;

import org.xutils.BuildConfig;
import org.xutils.x;

import java.io.File;

/**
 * Created by Administrator on 2017/1/6.
 */

public class MyApplication extends Application {
    File ff = new File(Environment.getExternalStorageDirectory().getPath() + "/aaa");

    @Override
    public void onCreate() {
        super.onCreate();
        x.Ext.init(this);
        x.Ext.setDebug(BuildConfig.DEBUG);

        ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(this)
                .memoryCacheSize(3)
                .threadPoolSize(3)
                .threadPriority(3)
                .diskCache(new UnlimitedDiscCache(ff))
                .build();
        ImageLoader.getInstance().init(configuration);
    }
}
